package com.hit.util;

import android.util.Log;

public class HitLog {
	private static final String TAG = "LogUtil";
	private static final int DOT_LEVEL = 3;

	public static void out(String message) {
		out(Log.DEBUG, TAG, message);
	}
	public static void out(int type, String message) {
		out(type, TAG, message);
	}

	public static void out(int logType, String tag, String message){
		switch (logType){
		
		case Log.DEBUG:
			Log.d(tag, out(message, DOT_LEVEL));
			break;
		case Log.ERROR:
			Log.e(tag, out(message, DOT_LEVEL));
			break;
		case Log.INFO:
			Log.i(tag, out(message, DOT_LEVEL));
			break;
		case Log.VERBOSE:
			Log.v(tag, out(message, DOT_LEVEL));
			break;
		case Log.WARN:
			Log.w(tag, out(message, DOT_LEVEL));
			break;
		default:
			Log.d(tag, out(message, DOT_LEVEL));
			break;
		}
	}

	private static String out(String mess, int level) {
		String className = Thread.currentThread().getStackTrace()[level].getClassName();
		int lineNumber = Thread.currentThread().getStackTrace()[level].getLineNumber();
		
		String result = className + "(): " + lineNumber + "\n\t" + mess;
		
		return result;
	}

}
